import {
	createI18n
} from "vue-i18n"; // v9.x
import en from "./en.json";
import ja from "./ja.json";
import ar from "./ar.json";
console.log(uni.getLocale())
let arr = ["en-US", "ar_SA", "Arab"]
let lang=uni.getStorageSync("lang")
const i18n = createI18n({
	legacy: false, // 必须设置false才能使用Composition API
	globalInjection: true, // 为每个组件注入$为前缀的全局属性和函数
	locale: arr.indexOf(lang) == -1 ? "en-US" : lang,
	messages: {
		"en-US": en,
		"ar_SA": ja,
		"Arab": ar
	},
});

export function setupI18n(app) {
	app.use(i18n);
}

export {
	i18n
};

// http://15.185.204.89:8082/app/staff/getMyShop?Authorization=eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjEwYzVkZTVhLWI0MjctNGZmMy1iYWI4LWIxZTNkNDc4OTExYSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.QubA3uE7qvz4EvkQUAlwErWE4kNUYPZUV_QyvPe40UvpFh8YbgaJK8SKkIK-5QfsxE-AfQqa9Fiaz666z2SLkA&Language=en-US